package Lab06.Extra2;
import java.util.Random;
public class ShapeFactoriesTest {
    static Shape makeShape(IShapeFactory factory, double a, double b){
        return factory.makeShape(a,b);
    }
    public static void main(String[] args){
        IShapeFactory[] factories = new IShapeFactory[3];
        factories[0] = new RectangleFactory();
        factories[1] = new RhombusFactory();
        factories[2] = new EllipseFactory();
        Random rand=new Random();
        for(IShapeFactory factory : factories){
                Shape shape=makeShape(factory,rand.nextDouble(1,10), rand.nextDouble(1,10));
                System.out.println(shape.getClass().getSimpleName()+" : "+shape.calcArea());
            }
        }
}
